﻿@{
    ViewBag.Title = "Index";
    Layout = "../Shared/_Layout.cshtml";
}

@using mscook.mvc;
@model IEnumerable<mscook.core.domain.Magazine>
@Html.Partial("_DeleteModal")

<div>
    <ul class="breadcrumb">
        <li>
            <a href="@Url.Action("index","home")">首页</a> <span class="divider">/</span>
        </li>
        <li>
            <a href="#">杂志</a>
        </li>
    </ul>
</div>
<div class="row-fluid sortable">
    <div class="box span12">
        <div class="box-header well" data-original-title="杂志列表">
            <h2>
                <i class="icon-list-alt"></i>
                杂志</h2>
            <div class="box-icon">
                <a href="@Url.Action("Add")"  class="btn btn-setting btn-round"><i class="icon-plus-sign"></i></a>
                 <a href="#" class="btn btn-minimize btn-round"><i class="icon-chevron-up"></i></a>
            </div>
        </div>
        <div class="box-content">
            <form class="form-horizontal" method="post" id="searchForm" action="@Url.Action("index")">
                <fieldset>
                    <div>
                        <input type="hidden" id="nowPageNum" name="nowPageNum" value="@ViewData["nowPageNum"]" />
                        <input type="hidden" id="per" name="per" value="@ViewData["per"]" />
                        <span>年份</span>

                        <input name="year" min="2010" type="number" value="@ViewData["year"]" class="">
                        <span>期数</span>
                        <input type="number" max="12" min="1" name="month" value="@ViewData["month"]" />
                    </div>

                    <div class="form-actions">
                        <button type="submit" class="btn btn-primary">搜索</button>
                    </div>
                </fieldset>
            </form>
        </div>

        <hr />


        <div class="box-content">
            <table class="table table-striped table-bordered bootstrap-datatable ">
                <thead>
                    <tr>
                        <th>年份/期数</th>
                        <th>所需积分</th>
                        <th>创建时间</th>
                        <th>操作</th>
                    </tr>
                </thead>
                <tbody>
                    @foreach (var Magazine in Model)
                    {
                        <tr>
                            <td>@Html.Encode(Magazine.Year+"/"+Magazine.Volume)</td>
                            <td>@Html.Encode(Math.Abs(Magazine.ResourceBonusSetting.Bonus))</td>
                            <td class="center">@Html.Encode(Magazine.CreateTime)</td>
                            <td class="center" data-id="@Magazine.Id">
                           
                                <a class="btn btn-info" href="@Url.Action("Edit", new { id = @Magazine.Id })">
                                    <i class="icon-edit icon-white"></i>
                                    修改                                            
                                </a>
                                <a class="btn btn-danger" href="@Url.Action("Delete", new { id = @Magazine.Id })">
                                    <i class="icon-trash icon-white"></i>
                                    删除
                                </a>
                                    <a class="btn btn-info" href="@Url.Action("ArticleIndex" + "/" + Magazine.Year + "/" + Magazine.Volume, new {id=@Magazine.Id })">
                                    <i class="icon-list-alt icon-white"></i>
                                    文章列表
                                </a>
                            </td>
                        </tr>
                    }

                </tbody>
            </table>
            @Html.Partial("_PageBreak");
        </div>
    </div>
</div>
